package bairui.international.console.web.controller.barter.property;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

import com.lianjing.sh.project.config.web.Project_Config_Web_PageTemplate;
import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.module.context.ModuleContext;
import com.lianjing.sh.spring.web.controller.enhance.navigations.context.NavigationContext;

import bairui.international.model.domain.jpa.TB_ProductProperty;
import bairui.international.service.Service_ProductProperty;

/**
 *
 * 编辑
 *
 * @generated
 * 
 * @see STest_C_Barter_Property_Edit_EditAccess 测试
 *
 */
@Controller
public class C_Barter_Property_Edit_EditAccess
 extends SC_Barter_Property_Edit_EditAccess 
{
	
	@Autowired private Service_ProductProperty service_ProductProperty;
	
	/**
	 * 访问编辑页面
	 */
	@Action(EditAccess.class)
	@GetMapping(EditAccess.RequestMappingValue)
	public ModelAndView editAccess(
		ModelMap map, HttpServletRequest request,
		NavigationContext navigationContext, ModuleContext moduleContext, 
		@PathVariable(name=EditAccess.PathVariableName.Id) long id
	) throws Exception {
		TB_ProductProperty bean = service_ProductProperty.findById(id);
		/* 模块 */
		moduleContext
			.addModule(module_Edit.module(
					bean,
					new C_Barter_Property_Edit_Edit.Edit.Operate(){
						@Override public Object getId() { return id; }
					}
				));
		//
		return Project_Config_Web_PageTemplate.Admin_Common(request);
	}
	

}
